﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PS_RoyalItemRepayDtls.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.PS_RoyalItemRepayDtls" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title></title>
    <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Scripts/DatePicker.js"></script>
</head>
<body>
    <form id="form1" runat="server">    
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">        
            <script type="text/javascript">
                function RowDblClick(sender, eventArgs) {
                    sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                }
                function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }
                function isNumberKeyDotComma(event)  // ตัวเลขทศนิยม และคอมม่า
                  {
                     var charCode = (event.which) ? event.which : event.keyCode
                     if(charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 46 && charCode != 44){
                         alert("กรุณากรอกข้อมูลเฉพาะตัวเลข!")
                         return false;
	                  }
                     return true;
                  }
            </script>        
    </telerik:RadCodeBlock>
    
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="cmdSearch">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cmdExpand">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1"
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="cmdCollapse">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTreeView1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadTreeView1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lblUpperText" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        Height="100%" Width="75px" Transparency="50">
        <table style="height: 100%; width: 100%" border="0">
            <tr>
                <td width="100%" align="center" valign="middle">
                    <img alt="Loading..." 
                        src="../Images/Buttons/loading.gif" 
                        style="border: 0px;" />
                </td>
            </tr>
        </table>
    </telerik:RadAjaxLoadingPanel>
                <telerik:RadGrid ID="RadGrid1" runat="server" 
                        AllowAutomaticDeletes="True" 
                        AllowFilteringByColumn="True" 
                        AllowMultiRowEdit="True" 
                        AllowMultiRowSelection="True" 
                        AllowPaging="True" 
                        AllowSorting="True" 
                        AutoGenerateColumns="False" 
                        EnableAJAX="True" 
                        EnableAJAXLoadingTemplate="True" 
                        GridLines="None" 
                        OnItemCommand="RadGrid1_ItemCommand" 
                        Width = "680px"
                        Skin="Outlook">
                    <MasterTableView 
                        AllowMultiColumnSorting="True" 
                        CellSpacing="-1" 
                        CommandItemDisplay="Top" 
                        DataKeyNames="Sequence" 
                        ClientDataKeyNames = "Sequence"
                        InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                        NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                        <CommandItemTemplate>
                            <table width="100%">
                                <tr>
                                    <td>
                                        <asp:LinkButton ID="cmdAddNew" runat="server" CausesValidation="False" 
                                            CommandName="InitInsert"                                            
                                            Visible="<%# !RadGrid1.MasterTableView.IsItemInserted && RadGrid1.EditIndexes.Count <= 0 %>">
                                        <img style="border:0px;vertical-align:middle;" alt="" 
                                        src="../Images/Buttons/AddRecord.gif" /> เพิ่มข้อมูลใหม่</asp:LinkButton>
                                        &nbsp;&nbsp;
                                                   </td>

                                </tr>
                            </table>
                        </CommandItemTemplate>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridEditCommandColumn                                 
                                ButtonType="ImageButton"                                 
                                EditImageUrl = "~/App_UI/Images/Buttons/Edit.gif"
                                EditText = "คลิกเพื่อแก้ไขข้อมูล"
                                UniqueName="EditCommandColumn2">
                                <HeaderStyle Width="15px" />
                                <ItemStyle />
                            </telerik:GridEditCommandColumn>
                            <telerik:GridButtonColumn 
                                ButtonType="ImageButton"
                                ConfirmText="ลบข้อมูลที่เลือก?"
                                ConfirmDialogType="RadWindow"
                                CommandName="Delete"
                                ImageUrl ="~/App_UI/Images/Buttons/Delete.gif" 
                                Text="คลิกเพื่อลบรายการ"
                                UniqueName="DeleteColumn2">
                                <HeaderStyle Width="15px" />
                                <ItemStyle HorizontalAlign="Center"/>
                            </telerik:GridButtonColumn>
                            <telerik:GridBoundColumn 
                                SortExpression="RoyalItems.Name" 
                                HeaderText="รายการเครื่องราชอิสริยาภรณ์" 
                                HeaderButtonType="TextButton"
                                DataField="RoyalItems.Name" 
                                UniqueName="RoyalItems.Name" 
                                AutoPostBackOnFilter="true" 
                                ShowFilterIcon="false"
                                FilterControlWidth="100%">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                SortExpression="Gender.NameThai" 
                                HeaderText="บุรุษ/สตรี" 
                                HeaderButtonType="TextButton"
                                DataField="Gender.NameThai" 
                                AutoPostBackOnFilter="true" 
                                ShowFilterIcon="false"
                                FilterControlWidth="100%"
                                UniqueName="Gender.NameThai">
                                <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                <ItemStyle HorizontalAlign="Center"/>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                SortExpression="Amount" 
                                HeaderText="ราคาชดใช้ (บาท)"
                                DataFormatString = "{0:#,###,###.##}"
                                HeaderButtonType="TextButton" 
                                DataField="Amount" 
                                AutoPostBackOnFilter="true" 
                                ShowFilterIcon="false"
                                FilterControlWidth="100%"
                                UniqueName="Amount">
                                <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                <ItemStyle HorizontalAlign="Center"/>
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn Visible ="false"
                                SortExpression="RoyalItems.RoyalItemTypes.Name" 
                                HeaderText="ประเภท " 
                                HeaderButtonType="TextButton"
                                DataField="RoyalItems.RoyalItemTypes.Name" 
                                UniqueName="RoyalItems.RoyalItemTypes.Name" 
                                AutoPostBackOnFilter="true" 
                                ShowFilterIcon="false"
                                FilterControlWidth="100%"
                                ReadOnly="true">
                            </telerik:GridBoundColumn>                           
                        </Columns>
                        <EditFormSettings
                            EditFormType="WebUserControl"                             
                            PopUpSettings-Height="230px" 
                            PopUpSettings-Modal="true" 
                            PopUpSettings-Width="700px" 
                            UserControlName="../UserControls/PS_RoyalItemRepayDtls.ascx">
                        <EditColumn UniqueName="EditCommandColumn2"></EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
                </telerik:RadGrid>
          <asp:Label ID="lblParent" runat="server" Visible="False"></asp:Label>
    </form>
</body>
</html>
